package com.easypay.reactive8583.iso;

import java.io.UnsupportedEncodingException;
import java.text.ParseException;

/**
 * @author pandans
 * @date 2021/03/04 15:54
 * @Description:
 */
public interface MessageFactory<T> {
    public T newMessage(int type);

    public T newMessage( MessageClass messageClass, MessageFunction messageFunction, MessageOrigin messageOrigin);

    public T createResponse(T requestMessage);
    public T createResponse(T request, Boolean copyAllFields);

    public T parseMessage(byte[] buf, int isoHeaderLength, Boolean binaryIsoHeader) throws ParseException, UnsupportedEncodingException;

    public T parseMessage(byte[]  buf, int isoHeaderLength) throws ParseException, UnsupportedEncodingException;
}
